package dto;
// Generated Mar 20, 2013 5:08:51 PM by Hibernate Tools 3.2.1.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import util.StringUtil;

/**
 * OrderStatus generated by hbm2java
 */
@Entity
@Table(name = "Order_Status", schema = "dbo", catalog = "AntiqueShop")
public class OrderStatus implements java.io.Serializable {

    private int id;
    private String description;
    private Set<Order> orders = new HashSet<Order>(0);

    public OrderStatus() {
        description = StringUtil.WAITING;
    }

    public OrderStatus(int id, String description) {
        this.id = id;
        this.description = description;
    }

    public OrderStatus(int id, String description, Set<Order> orders) {
        this.id = id;
        this.description = description;
        this.orders = orders;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public int getId() {
        return this.id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Column(name = "description", nullable = false)
    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "orderStatus")
    public Set<Order> getOrders() {
        return this.orders;
    }

    public void setOrders(Set<Order> orders) {
        this.orders = orders;
    }
}
